window.addEventListener('load', function () {
    let tbody = this.document.querySelector('tbody')
    axios({
        url: '/score/list'
    }).then(({ data: { data } }) => {
        // console.log(res);
        let htmlStr = ``
        for (let key in data) {
            htmlStr += ` <tr data-id='${key}'>
                            <th scope="row">${key}</th>
                            <td>${data[key].name}</td>
                            <td class="score" data-batch="1">${data[key].score[0]}</td>
                            <td class="score" data-batch="2">${data[key].score[1]}</td>
                            <td class="score" data-batch="3">${data[key].score[2]}</td>
                            <td class="score" data-batch="4">${data[key].score[3]}</td>
                            <td class="score" data-batch="5">${data[key].score[4]}</td>
                        </tr>`
        }
        tbody.innerHTML = htmlStr
    })
})